package com.coocaa.ops.common.core.base.enums;

/**
 * 鉴权枚举
 *
 * @author Administrator
 */
public enum AuthEnum {
    /**
     * 操作枚举
     */
    BROWSER(1, "Inquire"), ADD(2, "Add"), EDIT(3, "modify"), DELETE(4, "Delete"), SAVE(5, "Save"),
    AUDIT(10, "Review"), SHELVES(11, "Put on the shelf"), SOLDOUT(12, "Off shelf"), SYNCHRON(13, "Synchronize"), BATCHAUDIT(16, "Batch Review"),
    COLLECT(17, "Collect");
    public int key;
    public String value;

    AuthEnum(int key, String value) {
        this.key = key;
        this.value = value;
    }

    public static AuthEnum get(int key) {
        AuthEnum[] values = AuthEnum.values();
        for (AuthEnum object : values) {
            if (object.key == key) {
                return object;
            }
        }
        return null;
    }

    public static String getName(int key) {
        AuthEnum[] values = AuthEnum.values();
        for (AuthEnum object : values) {
            if (object.key == key) {
                return object.value;
            }
        }
        return null;
    }
}

